﻿using System;

using DreamCube.Foundation.Serialization;
using DreamCube.Framework.Utilities.BasicObject;

namespace DreamCube.WebServer.WinServiceModel
{
    /// <summary>
    /// 增加这个标志是用于控制没有标志的属性不会自动被序列化）
    /// </summary>
    [JsonObject(MemberSerialization.OptIn)]
    public class ServerConfig : ObjectX
    {
        /// <summary>
        /// 主网站的url路径
        /// </summary>
        public String MainServerUrl
        {
            get
            {
                return this.GetItemValue<String>("txt_MainServerUrl");
            }
            set
            {
                this.SetItemValue("txt_MainServerUrl", value);
            }
        }

        /// <summary>
        /// webhost的dll文件完整路径
        /// </summary>
        public String HostDllFilePath
        {
            get 
            {
                return this.GetItemValue<String>("txt_hostDllFilePath");
            }
            set 
            {
                this.SetItemValue("txt_hostDllFilePath", value);
            }
        }

        /// <summary>
        /// 网站的物理路径
        /// </summary>
        public String WebPhysicalPath
        {
            get
            {
                return this.GetItemValue<String>("txt_PhysicalPath");
            }
            set
            {
                this.SetItemValue("txt_PhysicalPath", value);
            }
        }

        /// <summary>
        /// 网站的端口号
        /// </summary>
        public Int32 Port
        {
            get
            {
                return this.GetItemValue<Int32>("txt_port");
            }
            set
            {
                this.SetItemValue("txt_port", value);
            }
        }

        /// <summary>
        /// 默认文档
        /// </summary>
        public String[] DefaultDos
        {
            get
            {
                return this.GetItemValue<String[]>("txt_DefaultDoc");
            }
            set
            {
                this.SetItemValue("txt_DefaultDoc", value);
            }
        }

        /// <summary>
        /// iis程序的路径
        /// </summary>
        public String IISAppPath
        {
            get
            {
                return this.GetItemValue<String>("txt_iisAppPath");
            }
            set
            {
                this.SetItemValue("txt_iisAppPath", value);
            }
        }

        /// <summary>
        /// 是否自启动
        /// </summary>
        public Boolean AutoRun
        {
            get
            {
                return this.GetItemValue<Boolean>("ck_autoRun");
            }
            set
            {
                this.SetItemValue("ck_autoRun", value);
            }
        }

        /// <summary>
        /// 网站的虚拟目录
        /// </summary>
        public String WebVirtualPath
        {
            get
            {
                return this.GetItemValue<String>("WebVirtualPath");
            }
            set
            {
                this.SetItemValue("WebVirtualPath", value);
            }
        }
    }
}
